<%@page import="com.user.bean.User"%>
<%@page import="com.user.service.impl.UserServiceImpl"%>
<%@page import="com.user.service.UserService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改信息页面</title>
</head>
<body>
	
	<%
		// 接收通过URL地址传来的用户id
		String userId = request.getParameter("updateId");
		
		UserService userService = new UserServiceImpl();
		User user = userService.searchUser(userId);
	%>
	<form action="UpdateServlet" method="post">
		<table>
			<tr>
				<td></td>
				<td><h4>请输入要修改的用户信息</h4></td>
				<td></td>
			</tr>
			<tr>
				<td>用户名：</td>
				<td><input type="text" name="uname" readonly="readonly" value="<%=user.getUserId() %>"/></td>
				<td></td>
			</tr>
			<tr>
				<td>密&nbsp;码：</td>
				<td><input type="password" name="pwd" value="<%=user.getPassword() %>"/></td>
				<td></td>
			</tr>
			<tr>
				<td>姓&nbsp;名：</td>
				<td><input type="text" name="realName" value="<%=user.getUserName() %>"/></td>
				<td></td>
			</tr>
			<tr>
				<td>性&nbsp;别：</td>
				<%
					if(user.getSex().equals("男")==true){
				%>
					<td><input type="radio" name="sex" value="男" checked="checked"/>男<input type="radio" name="sex" value="女"/>女</td>
				<%
					}else{
				%>
					<td><input type="radio" name="sex" value="男"/>男<input type="radio" name="sex" value="女" checked="checked"/>女</td>
				
				<%
					}
				%>
				<td></td>
			</tr>
			<tr>
				<td>年&nbsp;龄：</td>
				<td><input type="text" name="age" value="<%=user.getAge() %>"/></td>
				<td></td>
			</tr>
			<tr>
				<td>身份证号码：</td>
				<td><input type="text" name="cardID" value="<%=user.getIdcard() %>"/></td>
				<td></td>
			</tr>
			<tr>
				<td>手机号码：</td>
				<td><input type="text" name="phone" value="<%=user.getPhone() %>"/></td>
				<td></td>
			</tr>
			<tr>
				<td>地址：</td>
				<td><input type="text" name="address" value="<%=user.getAddress() %>"/></td>
				<td></td>
			</tr>
			<tr>
				<td>邮箱：</td>
				<td><input type="text" name="email" value="<%=user.getEmail() %>"/></td>
				<td></td>
			</tr>
			<tr>
				<td></td>
				<td><input type="submit" value="确定修改"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="重置"/></td>
				<td></td>
			</tr>
			
		</table>
	</form>
	
</body>
</html>